/***********************************************************************
 * Module:  SigmoidalActivationFunction.java
 * Author:  Mladen
 * Purpose: Defines the Class SigmoidalActivationFunction
 ***********************************************************************/

package raf.functions;


public class SigmoidalActivationFunction implements ActivationFunction {

	public Double calculate(Double _arg) {
		return 1/(1+Math.exp(-_arg));
	}

	public Double calcualteDerivative(Double _argument) {
		// wouldnt it be nice to just write
		// return f*(1-f) where f=calculate(_argument); :p
		Double f = calculate(_argument);
		return f*(1-f);
	}
}